From 5a0bc518455ddd0b1860d13adbac5997e1f0f960 Mon Sep 17 00:00:00 2001 From: Bryan Tong Minh Date: Thu, 15 May 2008 20:39:09 +0000 Subject: [PATCH] Force output of a full URL in Special:Filepath and ApiQueryImageInfo in case the wiki images are not configured to full urls. (using wfExpandUrl this time) --- includes/SpecialFilepath.php | 2 +- includes/api/ApiQueryImageInfo.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/SpecialFilepath.php b/includes/SpecialFilepath.php index 84412ab616..37703dfa4c 100644 --- a/includes/SpecialFilepath.php +++ b/includes/SpecialFilepath.php @@ -13,7 +13,7 @@ function wfSpecialFilepath( $par ) { } else { $file = wfFindFile( $title ); if ( $file && $file->exists() ) { - $wgOut->redirect( $file->getURL() ); + $wgOut->redirect( wfExpandUrl( $file->getURL() ) ); } else { $wgOut->setStatusCode( 404 ); $cform = new FilepathForm( $title ); diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index fdb389f81c..b0d8289c70 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -129,12 +129,12 @@ class ApiQueryImageInfo extends ApiQueryBase { $thumb = $f->getThumbnail($this->urlwidth, $this->urlheight); if($thumb) { - $vals['thumburl'] = $thumb->getURL(); + $vals['thumburl'] = wfExpandUrl( $thumb->getURL() ); $vals['thumbwidth'] = $thumb->getWidth(); $vals['thumbheight'] = $thumb->getHeight(); } } - $vals['url'] = $f->getURL(); + $vals['url'] = wfExpandUrl( $f->getURL() ); } if($this->fld_comment) $vals['comment'] = $f->getDescription(); -- 2.20.1